﻿#ifndef __POPMENU_H__
#define __POPMENU_H__


#include <QWidget>
#include <QLabel>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QMap>
#include "../../imgdisplay.h"

class PopMenu : public QWidget
{
	Q_OBJECT
private:
	QVBoxLayout* main_vlay;
	QMap<QString, QList<QWidget*>> menu_group;
	QMap<QString, QVBoxLayout*> menu_vlay;
	int show_x;
	int show_y;
public:
	explicit PopMenu(QWidget* parent = nullptr);
	void addAction(const QString& group, const QString& desc, const QString& icon = "");
	void setShowPoint(int x, int y);
protected:
	void showEvent(QShowEvent* event) override; 
	void focusOutEvent(QFocusEvent* event) override;
	void paintEvent(QPaintEvent* event) override;
};


#endif // !__POPMENU_H__
